#ifndef TOCCHARMODEL_H
#define TOCCHARMODEL_H

#include <QObject>
#include <QVariantList>

class TocCharModel : public QObject
{
    Q_OBJECT

    // PROPERTIES
    Q_PROPERTY(QString PlayerName READ playerName WRITE setPlayerName NOTIFY playerNameChanged)
    Q_PROPERTY(QString CharacterName READ characterName WRITE setCharacterName NOTIFY characterNameChanged )
    Q_PROPERTY(QString Occupation READ occupation WRITE setOccupation NOTIFY occupationChanged )
    Q_PROPERTY(QString OccupationBenefits READ occupationBenefits WRITE setOccupationBenefits NOTIFY occupationBenefitsChanged )
    Q_PROPERTY(QString Drive READ drive WRITE setDrive NOTIFY driveChanged )
    Q_PROPERTY(QString Pillars READ pillars WRITE setPillars NOTIFY pillarsChanged )

    Q_PROPERTY(int ToHit READ toHit WRITE setToHit NOTIFY toHitChanged)
    Q_PROPERTY(int BuildPoints READ buildPoints WRITE setBuildPoints NOTIFY buildPointsChanged)
    Q_PROPERTY(int SkillPoints READ skillPoints WRITE setSkillPoints NOTIFY skillPointsChanged) 

    Q_PROPERTY(QVariantList Abilities READ abilities WRITE setAbilities)
    Q_PROPERTY(QVariantList OccupAbilities READ occupAbilities WRITE setOccupAbilities)
    Q_PROPERTY(QVariantList Clues READ clues WRITE setClues)
    Q_PROPERTY(QVariantList Contacts READ contacts WRITE setContacts)
    Q_PROPERTY(QVariantList Weapons READ weapons WRITE setWeapons)

    Q_PROPERTY(QString Clipboard READ clipboard WRITE setClipboard)

    Q_PROPERTY(QString DataVersion READ dataVersion WRITE setDataVersion)
    Q_PROPERTY(QString DataLocale READ dataLocale WRITE setDataLocale)

    Q_PROPERTY(int SpentBp READ calculateSpentBp)
    Q_PROPERTY(int SpentSp READ calculateSpentSp)

public:
    explicit TocCharModel(QObject *parent = 0);

public: // PROPERTY GETTER
    QString playerName() const;
    QString characterName() const;
    QString occupation() const;
    QString occupationBenefits() const;
    QString drive() const;
    QString pillars() const;

    int toHit() const;
    int buildPoints() const;
    int skillPoints() const;

    QVariantList abilities() const;
    QVariantList occupAbilities() const;
    QVariantList clues() const;
    QVariantList contacts() const;
    QVariantList weapons() const;

    QString clipboard() const;

    QString dataVersion() const;
    QString dataLocale() const;

    int calculateSpentBp() const;
    int calculateSpentSp() const;

public slots: // PROPERTY SETTER
    void setPlayerName(QString);
    void setCharacterName(QString);
    void setOccupation(QString);
    void setOccupationBenefits(QString);
    void setDrive(QString);
    void setPillars(QString);

    void setToHit(int);
    void setBuildPoints(int);
    void setSkillPoints(int);

    void setAbilities(QVariantList);
    void setOccupAbilities(QVariantList);
    void setClues(QVariantList);
    void setContacts(QVariantList);
    void setWeapons(QVariantList);

    void setClipboard(QString);

    void setDataVersion(QString);
    void setDataLocale(QString);

signals: // PROPERTY CHANGE NOTIFY
    void playerNameChanged(QString);
    void characterNameChanged(QString);
    void occupationChanged(QString);
    void occupationBenefitsChanged(QString);
    void driveChanged(QString);
    void pillarsChanged(QString);

    void toHitChanged(int);
    void buildPointsChanged(int);
    void skillPointsChanged(int);

private: // PROPERTY VALUES
    QString plName;
    QString chName;
    QString chOcp;
    QString chOcpBnf;
    QString chDrive;
    QString chPillars;

    int chToHit;
    int chBuildPoints;
    int chSkillPoints;

    QVariantList chAbilities;
    QVariantList chOccupAbilities;
    QVariantList chClues;
    QVariantList chContacts;
    QVariantList chWeapons;

    QString chClipboard;

    QString chDataVersion;
    QString chDataLocale;
};

#endif // TOCCHARMODEL_H
